package com.hrbxlh.virtualization.service;

import com.github.pagehelper.PageInfo;
import com.hrbxlh.virtualization.dto.FlavorDTO;
import com.hrbxlh.virtualization.param.ContainerQueryParam;
import com.hrbxlh.virtualization.pojo.Container;
import com.hrbxlh.virtualization.pojo.Image;
import com.hrbxlh.virtualization.vo.ContainerVO;

import java.util.List;

/**
 * @author cheer
 */
public interface ContainerService {

    /**
     * 分页查询容器列表
     */
    PageInfo<ContainerVO> listContainersByPage(Integer pageNum, Integer pageSize, ContainerQueryParam containerQueryParam);

    /**
     * 批量删除容器
     *
     * @param containerIdList 容器Id集合
     */
    void deleteContainers(List<Long> containerIdList);

    /**
     * 刪除容器
     *
     * @param container 单个容器对象
     */
    void deleteContainer(Container container);

    /**
     * 删除所有容器
     */
    void deleteAllContainers();

    /**
     * 创建容器
     */
    Container createContainer(Image image);

    /**
     * 创建容器
     */
    Container createContainer(Image image, String hostname);

    Container createContainer(Image image, String volumeName, FlavorDTO flavorDTO, String hostname);

    void deleteContainerById(Long containerId);

    boolean startContainer(Container container);

    void deleteContainerFile(String stuorteaId);

    void deleteContainerByCourse(String stuorteaId, Integer courseId, Integer chapterId);
}
